const path = require("path");
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    static: {
      directory: path.join(__dirname, "public"),
    },
    host: "127.0.0.1",
    port: 8088,
    // 钩子
    onBeforeSetupMiddleware({ app }) {
      // 定义路由 http://127.0.0.1:8088/users
      app.get("/users", (req, res) => {
        res.send("hello users");
      });
    },
  },
});
